func go/types.assert

178 uses

	go/types (current package)
		alias.go#L69: 	assert(a.targs == nil)
		alias.go#L137: 	assert(len(targs) > 0)
		assignments.go#L31: 		assert(isTypes2)
		assignments.go#L136: 	assert(isConstType(x.typ()))
		assignments.go#L304: 	assert(!(variadic && hasDots))
		builtins.go#L331: 			assert(!isTypeParam(typ))
		builtins.go#L485: 			assert(!isTypeParam(typ))
		builtins.go#L669: 				assert(isTyped(x.typ()))
		builtins.go#L986: 	assert(x.isValid())
		builtins.go#L1143: 		assert(!isUntyped(res))
		call.go#L35: 	assert(T != nil || ix != nil)
		call.go#L56: 		assert(len(targs) == len(xlist))
		call.go#L123: 	assert(got == want)
		call.go#L133: 	assert(check != nil)
		call.go#L134: 	assert(len(targs) == typ.TypeParams().Len())
		call.go#L149: 	assert(inst.TypeParams().Len() == 0) // signature is not generic anymore
		call.go#L151: 	assert(len(xlist) <= len(targs))
		call.go#L179: 			assert(x.mode() == value)
		call.go#L283: 		assert(len(targs) == len(xlist))
		call.go#L385: 						assert(n < x.typ().(*Signature).TypeParams().Len())
		call.go#L578: 	assert(len(tparams) == len(targs))
		call.go#L614: 	assert(len(tparams) == len(targs))
		call.go#L702: 			assert(pname.pkg == check.pkg)
		call.go#L759: 				assert(exp.Val() != nil)
		check.go#L518: 	assert(top <= len(check.delayed)) // stack must not have shrunk
		const.go#L23: 	assert(x.mode() == constant_)
		const.go#L258: 	assert(v != nil)
		const.go#L267: 	assert(x.mode() == constant_)
		context.go#L69: 	assert(ctxt != nil)
		context.go#L70: 	assert(orig != nil)
		context.go#L112: 	assert(inst != nil)
		cycles.go#L104: 			assert(i < 0)
		decl.go#L123: 		assert(obj.Type() != nil)
		decl.go#L137: 	assert(ok)
		decl.go#L185: 	assert(found)
		decl.go#L388: 	assert(obj.typ == nil)
		decl.go#L434: 	assert(obj.typ == nil)
		decl.go#L459: 		assert(lhs == nil || lhs[0] == obj)
		decl.go#L497: 	assert(obj.typ == nil)
		decl.go#L547: 		assert(rhs != nil)
		decl.go#L573: 	assert(rhs != nil)
		decl.go#L608: 	assert(!check.inTParamList)
		decl.go#L685: 	assert(!check.objMap[obj].tdecl.Assign.IsValid()) // don't use TypeName.IsAlias (requires fully set up object)
		decl.go#L694: 		assert(base.TypeArgs().Len() == 0) // collectMethods should not be called on an instantiated type
		decl.go#L707: 			assert(m.name != "_")
		decl.go#L708: 			assert(mset.insert(m) == nil)
		decl.go#L716: 		assert(m.name != "_")
		decl.go#L737: 			assert(m.name != "_")
		decl.go#L738: 			assert(mset.insert(m) == nil)
		decl.go#L763: 	assert(obj.typ == nil)
		decl.go#L766: 	assert(check.iota == nil)
		decl.go#L863: 							assert(obj.typ != nil)
		errors.go#L18: func assert(p bool) {
		errors.go#L157: 	assert(code != 0)
		errors.go#L167: 			assert(check.iota != nil)
		errors.go#L286: 		assert(start <= pos && pos < end)
		errsupport.go#L56: 			assert(alt != sel) // otherwise there is no lookup error
		expr.go#L1382: 			assert(t.Len() != 1)
		gcsizes.go#L17: 		assert(result >= 1)
		gcsizes.go#L54: 		assert(!isTypeParam(T))
		gcsizes.go#L104: 		assert(isTyped(T))
		gcsizes.go#L157: 		assert(!isTypeParam(T))
		index.go#L439: 	assert(ok)
		infer.go#L42: 			assert(inferred == nil || len(inferred) == len(tparams) && !slices.Contains(inferred, nil))
		infer.go#L55: 	assert(n > 0 && len(targs) <= n)
		infer.go#L58: 	assert(params.Len() == len(args))
		infer.go#L359: 		assert(isTyped(d))
		infer.go#L375: 			assert(targ == nil || inferred[i] == targ)
		infer.go#L661: 			assert(n == 0)
		infer.go#L674: 			assert(single.typ.Underlying() == u)
		instantiate.go#L110: 	assert(len(ctxts) > 0)
		instantiate.go#L158: 		assert(expanding == nil) // function instances cannot be reached from Named types
		instantiate.go#L162: 		assert(orig.RecvTypeParams() == nil)
		instantiate.go#L163: 		assert(orig.TypeParams() != nil)
		labels.go#L61: 		assert(b.gotoTarget(name) == nil)
		lookup.go#L216: 						assert(f.typ != nil)
		lookup.go#L246: 					assert(m.typ != nil)
		lookup.go#L572: 	assert(isInterfacePtr(T))
		mono.go#L219: 			assert(typ.Obj().Pkg() == pkg)
		named.go#L238: 		assert(n.fromRHS == nil) // instantiated types are not declared types
		named.go#L239: 		assert(n.loader == nil)  // cannot import an instantiation
		named.go#L254: 		assert(!n.stateHas(hasUnder))
		named.go#L266: 		assert(n.fromRHS == nil) // not loaded yet
		named.go#L267: 		assert(n.inst == nil)    // cannot import an instantiation
		named.go#L289: 	assert(!n.stateHas(hasUnder))
		named.go#L308: 			assert(m&lazyLoaded != 0)
		named.go#L312: 			assert(u)
		named.go#L316: 			assert(u)
		named.go#L320: 			assert(u)
		named.go#L345: 	assert(len(targs) > 0)
		named.go#L401: 	assert(t.inst == nil)
		named.go#L440: 	assert(t.inst != nil) // only instances should have unexpanded methods
		named.go#L447: 		assert(len(t.methods) == 0)
		named.go#L452: 		assert(t.inst.ctxt != nil) // we should still have a context remaining from the resolution phase
		named.go#L474: 	assert(orig != nil)
		named.go#L532: 	assert(t.inst == nil)
		named.go#L555: 	assert(samePkg(t.obj.pkg, m.pkg))
		named.go#L556: 	assert(t.inst == nil)
		named.go#L591: 		assert(n.stateHas(lazyLoaded | unpacked))
		named.go#L608: 		assert(n.allowNilRHS)
		named.go#L639: 	assert(n.stateHas(lazyLoaded | unpacked))
		named.go#L655: 				assert(!seen[t])
		named.go#L672: 			assert(rhs != nil)
		named.go#L758: 	assert(!n.stateHas(unpacked))
		named.go#L759: 	assert(n.inst.orig.stateHas(lazyLoaded | unpacked))
		named.go#L777: 	assert(n == u)
		named.go#L794: 				assert(iface.complete) // otherwise we are copying incomplete data
		object.go#L136: func (obj *object) setOrder(order uint32)     { assert(order > 0); obj.order_ = order }
		object.go#L614: 		assert(Identical(typ, &emptyInterface))
		operand.go#L349: 		assert(Vp == nil)
		range.go#L123: 			assert(obj.typ == nil)
		range.go#L135: 				assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
		range.go#L144: 			assert(obj.typ != nil)
		range.go#L170: 				assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
		range.go#L239: 		assert(typ.dir != SendOnly)
		range.go#L253: 		assert(typ.Recv() == nil)
		range.go#L276: 		assert(cb.Recv() == nil)
		recording.go#L34: 	assert(x.expr != nil && typ != nil)
		recording.go#L60: 	assert(x != nil)
		recording.go#L61: 	assert(typ != nil)
		recording.go#L66: 		assert(val != nil)
		recording.go#L69: 		assert(!isValid(typ) || allBasic(typ, IsConstType))
		recording.go#L98: 	assert(x != nil)
		recording.go#L99: 	assert(len(a) == 2)
		recording.go#L104: 	assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
		recording.go#L108: 			assert(tv.Type != nil) // should have been recorded already
		recording.go#L134: 	assert(ident != nil)
		recording.go#L135: 	assert(typ != nil)
		recording.go#L159: 	assert(id != nil)
		recording.go#L166: 	assert(id != nil)
		recording.go#L167: 	assert(obj != nil)
		recording.go#L174: 	assert(node != nil)
		recording.go#L175: 	assert(obj != nil)
		recording.go#L182: 	assert(obj != nil && (recv == nil || len(index) > 0))
		recording.go#L190: 	assert(node != nil)
		recording.go#L191: 	assert(scope != nil)
		resolver.go#L106: 	assert(ident.Name == obj.Name())
		sizes.go#L55: 		assert(result >= 1)
		sizes.go#L92: 		assert(!isTypeParam(T))
		sizes.go#L170: 		assert(isTyped(T))
		sizes.go#L224: 		assert(!isTypeParam(T))
		sizes.go#L341: 	assert(x >= 0 && 1 <= a && a <= 8 && a&(a-1) == 0)
		stmt.go#L353: 	assert(T != nil)
		stmt.go#L406: 	assert(T != nil)
		stmt.go#L419: 			assert(scope == check.scope)
		subst.go#L21: 	assert(len(tpars) == len(targs))
		subst.go#L32: 	assert(len(from) == len(to))
		subst.go#L59: 	assert(expanding != nil || ctxt != nil)
		subst.go#L198: 					assert(ok == instantiating)
		subst.go#L281: 			assert(t.complete) // otherwise we are copying incomplete data
		typeset.go#L119: 		assert(t.typ != nil)
		typeset.go#L126: 			assert(Identical(u, u.Underlying()))
		typeset.go#L143: 		assert(t.typ != nil)
		typeset.go#L273: 			assert(!isTypeParam(typ))
		typeset.go#L292: 			assert(!tset.comparable)
		typeset.go#L293: 			assert(len(tset.methods) == 0)
		typeset.go#L336: 			assert(t.typ != nil)
		typeset.go#L347: 	assert(!comp || terms.isAll()) // comparable invariant
		typeset.go#L389: 			assert(!isTypeParam(t.typ))
		typestring.go#L86: 	assert(ctxt != nil)
		typestring.go#L358: 	assert(w.ctxt != nil)
		typestring.go#L478: 			assert(w.tparams == nil)
		typexpr.go#L71: 	assert(typ != nil)
		typexpr.go#L100: 		assert(x.val != nil)
		typexpr.go#L183: 	assert(isTyped(typ))
		typexpr.go#L201: 	assert(isTyped(typ))
		unify.go#L93: 	assert(len(tparams) >= len(targs))
		unify.go#L228: 	assert(hx != nil)
		unify.go#L244: 	assert(t != nil)
		unify.go#L350: 		assert(!isTypeParam(y))
		unify.go#L454: 	assert(x != y && Unalias(x) != Unalias(y))
		unify.go#L669: 		assert(!u.enableInterfaceInference || mode&exact != 0) // handled before this switch
		unify.go#L767: 			assert(u.asBoundTypeParam(x) == nil)
		union.go#L56: 	assert(len(blist) == len(tlist)-1)
		union.go#L172: 	assert(!IsInterface(y.typ))
		universe.go#L263: 	assert(obj.Type() != nil)
		validtype.go#L122: 				assert(t.obj.pkg == check.pkg)
		validtype.go#L123: 				assert(t.Origin().obj.pkg == check.pkg)